
This repository contains all the files necessary to fully replicate all results reported in �The Nonviolent Resistance Resource Curse: Negative Effects of Oil and Gas Revenue on Civil Resistance Campaign Onset.� This memo describes each file and their relationships to one another.

All analysis was done in the R statistical computing platform (Version 3.6.1), using RStudio version 1.2.5019. The coding structure relies on common functions from the �Tidyverse� set of packages, particularly the use of the �pipe� (denoted in R code as %>%) to sequence functions. For more information, see https://www.tidyverse.org/.

Regression models are run almost entirely using R�s standard �lm� and �glm� functions for OLS regression and logistic regression respectively. Robust clustered standard errors are calculated using the �cluster.vcov� function from the �multiwayvcov� package (See https://www.rdocumentation.org/packages/multiwayvcov/versions/1.2.3 for more information).  Multi-level models are run using the �lmer� and �glmer� functions from the �lme4� package (see https://www.rdocumentation.org/packages/lme4/versions/1.1-21 for more information).  

Oil_gas_data.rds

This file contains the primary dataset used in the analysis. It is an rds file, which means it generates a single R object, in this case a list of datasets with all the variables needed to conduct the analysis. It combines data from several sources, particularly the Varieties of Democracy dataset (Version 9), the Ross and Mahdavi oil and gas revenue data, and the Nonviolent and Violent Campaigns and Outcomes dataset (Version 2.1). Full citation information for each source dataset is in the main text of the article.

Main_analysis_syntax.rmd

This file runs all the analysis reported in the main text and appendix. In order to run properly, it will need to be placed in the same folder as the rds file, and the R packages listed in the first code chunk will have to be installed. It generates an HTML file containing a log of all the code run to generate the results, as well as the results themselves. To output the html file, the user will have to �knit� the markdown, either by selecting the �Knit� button on the center top of the Rstudio console, or by pressing Ctrl+Shift+K
